package com.senlingspace.payment.enums;

/**
 * 拉卡拉支付账户类型枚举
 *
 * @author lebronjames
 * @date 2024/07/24
 */
public enum LakalaAccountTypeEnum {

    WECHAT("WECHAT", "微信"),
    ALIPAY("ALIPAY", "支付宝"),
    UQRCODEPAY("UQRCODEPAY", "银联"),
    BESTPAY("BESTPAY", "翼支付"),
    SUNING("SUNING", "苏宁易付宝");

    private final String code;
    private final String description;

    LakalaAccountTypeEnum(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static LakalaAccountTypeEnum fromCode(String code) {
        for (LakalaAccountTypeEnum type : values()) {
            if (type.getCode().equalsIgnoreCase(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown account type code: " + code);
    }

}
